select * from
(
select 
0 auditid
,aa.annotationid
,aa.itemid
,aa.typeid
,aa.rtftext
,aa.searchtext
,aa.config
,aa.dts
,aa.userid
,0 deletestatus
,ii.contentid
from annotations aa
inner join items ii on aa.itemid = ii.itemid
--where annotationid = 112
--where ii.contentid = 10181
union
select 
aa.auditid
,aa.annotationid
,aa.itemid
,aa.typeid
,aa.rtftext
,aa.searchtext
,aa.config
,aa.dts
,aa.userid
,aa.deletestatus
,ii.contentid
from annotationaudits aa
inner join items ii on aa.itemid = ii.itemid
--where annotationid = 112
) ah
where contentid = 10181
order by annotationid,dts
